package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.JkyTradeLogInfo;
import com.ethink.order.common.entity.JkyTradeLog;

/**
 * 吉客云销售单 Converter转换器
 *
 * @author default
 * @date 2022-11-25
 */
@Component
public class JkyTradeLogConverter implements Converter<JkyTradeLogInfo, JkyTradeLog> {

    @Override
    public JkyTradeLog convertTo(JkyTradeLogInfo info) {
        if(info == null) {
            return null;
        }
        JkyTradeLog entity = new JkyTradeLog ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public JkyTradeLogInfo convertFrom(JkyTradeLog entity) {
        if(entity == null) {
            return null;
        }
        JkyTradeLogInfo info = new JkyTradeLogInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
